import request from '@/config/axios'

// 收货地区列 VO
export interface GlobeStateHarvestVO {
  id: number // 收货地区id
  detailStateId: number // 国家地区详情id
  logisticsMode: string // 物流方式
  storeNumber: string // 门店号码
  storeName: string // 门店名称
  detailedAddress: string // 详情地址
  phone: number // 联系电话
  closureTime: string // 关店时间
}

// 收货地区列 API
export const GlobeStateHarvestApi = {
  // 查询收货地区列分页
  getGlobeStateHarvestPage: async (params: any) => {
    return await request.get({ url: `/trade/globe-state-harvest/page`, params })
  },

  // 查询收货地区列详情
  getGlobeStateHarvest: async (id: number) => {
    return await request.get({ url: `/trade/globe-state-harvest/get?id=` + id })
  },

  // 新增收货地区列
  createGlobeStateHarvest: async (data: GlobeStateHarvestVO) => {
    return await request.post({ url: `/trade/globe-state-harvest/create`, data })
  },

  // 修改收货地区列
  updateGlobeStateHarvest: async (data: GlobeStateHarvestVO) => {
    return await request.put({ url: `/trade/globe-state-harvest/update`, data })
  },

  // 删除收货地区列
  deleteGlobeStateHarvest: async (id: number) => {
    return await request.delete({ url: `/trade/globe-state-harvest/delete?id=` + id })
  },

  // 导出收货地区列 Excel
  exportGlobeStateHarvest: async (params) => {
    return await request.download({ url: `/trade/globe-state-harvest/export-excel`, params })
  },
  // 添加常用地址
  addGlobeStateCollection: async (data: any) => {
    return await request.post({ url: `/trade/globe-state-collection/create`, data })
  },
  // 查询常用地址
  getGlobeStateCollection: async (params: any) => {
    return await request.get({ url: `/trade/globe-state-collection/page`, params })
  },
  // 删除常用地址
  deleteGlobeStateCollection: async (id: number) => {
    return await request.delete({ url: `/trade/globe-state-collection/delete?areaId=` + id })
  }
}
